//package com.yiwei.hdb.impl;
//
//import android.content.Context;
//
//import com.yiwei.hdb.util.PreferenceUtils;
//import com.yiwei.hdb.constant.Const;
//import com.yiwei.hdb.http.CallBackListener;
//import com.yiwei.hdb.http.InterfaceServer;
//import com.yiwei.hdb.http.InfoCallBack;
//import com.yiwei.hdb.interfaces.InitAppInfo;
//import com.yiwei.hdb.model.InitAppModel;
//import com.yiwei.hdb.model.RequestModel;
//import com.yiwei.hdb.util.PackageUtil;
//import com.yiwei.hdb.util.RBInfo;
//
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * app启动初始化数据
// * Created by Master.Dong on 2016/4/13.
// */
//public class InitAppInfoImpl implements InitAppInfo {
//
//    @Override
//    public void getInitInfo(final Context mContext, final InfoCallBack callBack) {
//        Map<String, Object> mapData = new HashMap<String, Object>();
//        mapData.put("client_type", Const.CLIENT_TYPE);
//        mapData.put("device_id", RBInfo.getInstance().getUniquePsuedoID());
//        mapData.put("user_agent", RBInfo.getInstance().getUserAgent());
//        mapData.put("os", Const.DevType.ANDROID);
//        mapData.put("os_version", RBInfo.getInstance().getOSVersion());
//        mapData.put("browser", "");
//        mapData.put("browser_version", "");
//        mapData.put("mobile_brand", RBInfo.getInstance().getBrand());
//        mapData.put("mobile_model", RBInfo.getInstance().getModel());
//
//
//        mapData.put("app_version", PackageUtil.getVersionName(mContext));
//        double lat = PreferenceUtils.getDouble(mContext.getApplicationContext(), Const.KEY.LAT, -1);
//        double lng = PreferenceUtils.getDouble(mContext.getApplicationContext(), Const.KEY.LNG, -1);
//        if (lat>0&&lng>0) {
//            mapData.put("lat", lat + "");
//            mapData.put("lang", lng + "");
//        }
//        RequestModel model = new RequestModel(mapData);
//        InterfaceServer.getInstance(mContext.getApplicationContext()).requestInterface(Const.APP_INIT, Const.RequestMethod.POST, model,Const.DEFAULT_TIMEOUT,new CallBackListener<InitAppModel>(InitAppModel.class,callBack));
//
////        InterfaceServer.getInstance(mContext.getApplicationContext()).requestInterface(Const.APP_INIT, Const.RequestMethod.POST, model,Const.DEFAULT_TIMEOUT, new ResponseListener() {
////            @Override
////            public void onStartInMainThread(Object result) {
////                callBack.onFailure(result.toString());
////            }
////
////            @Override
////            public void onFinishInMainThread(Object result) {
////            }
////
////
////            @Override
////            public Object onSuccessInRequestThread(int statusCode, String content) {
////                try {
////                    return JsonUtil.<InitAppModel>fromJson(content, InitAppModel.class);
////                } catch (Exception e) {
////                    return null;
////                }
////            }
////
////            @Override
////            public void onSuccessInMainThread(int statusCode, String content, Object result) {
////                try {
////                    InitAppModel model = (InitAppModel) result;
////
////                    callBack.onSuccess(model);
////                    //返回数据接口
////                } catch (Exception e) {
////                    e.printStackTrace();
////                }
////            }
////        });
//    }
//
//}
